
    <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>Title</title>
    </head>
    <body>
    
<div class="archive_info">
<h1>HTML <span class="color_h1">框架</span></h1>
<hr/><p class="intro">通过使用框架，你可以在同一个浏览器窗口中显示不止一个页面。</p>
<iframe height="300px" src="https://www.runoob.com" width="99%"></iframe>
<hr/><p><b>iframe语法:</b></p>
<pre>&lt;iframe src="URL"&gt;&lt;/iframe&gt;</pre>
<p>该URL指向不同的网页。</p>
<hr/><h2>iframe - 设置高度与宽度</h2>
<p>height 和 width 属性用来定义iframe标签的高度与宽度。</p>
<p>属性默认以像素为单位, 但是你可以指定其按比例显示 (如："80%")。</p>
<div class="example">
<h2 class="example">实例</h2>
<div class="example_code">
<div class="hl-main"><span class="hl-brackets">&lt;</span><span class="hl-reserved">iframe</span><span class="hl-code"> </span><span class="hl-var">src</span><span class="hl-code">=</span><span class="hl-quotes">"</span><span class="hl-string">demo_iframe.htm</span><span class="hl-quotes">"</span><span class="hl-code"> </span><span class="hl-var">width</span><span class="hl-code">=</span><span class="hl-quotes">"</span><span class="hl-string">200</span><span class="hl-quotes">"</span><span class="hl-code"> </span><span class="hl-var">height</span><span class="hl-code">=</span><span class="hl-quotes">"</span><span class="hl-string">200</span><span class="hl-quotes">"</span><span class="hl-brackets">&gt;</span><span class="hl-brackets">&lt;/</span><span class="hl-reserved">iframe</span><span class="hl-brackets">&gt;</span></div>
</div>
<br/>
<a class="tryitbtn"  rel="noopener" target="_blank">尝试一下 »</a>
</div>
<br/>
<hr/><h2>iframe - 移除边框</h2>
<p>frameborder 属性用于定义iframe表示是否显示边框。</p>
<p>设置属性值为 "0" 移除iframe的边框:</p>
<div class="example">
<h2 class="example">实例</h2>
<div class="example_code notranslate">
<div class="hl-main"><span class="hl-brackets">&lt;</span><span class="hl-reserved">iframe</span><span class="hl-code"> </span><span class="hl-var">src</span><span class="hl-code">=</span><span class="hl-quotes">"</span><span class="hl-string">demo_iframe.htm</span><span class="hl-quotes">"</span><span class="hl-code"> </span><span class="hl-var">frameborder</span><span class="hl-code">=</span><span class="hl-quotes">"</span><span class="hl-string">0</span><span class="hl-quotes">"</span><span class="hl-brackets">&gt;</span><span class="hl-brackets">&lt;/</span><span class="hl-reserved">iframe</span><span class="hl-brackets">&gt;</span></div>
</div>
<br/>
<a class="tryitbtn"  rel="noopener" target="_blank">尝试一下 »</a>
</div>
<br/>
<hr/><h2>使用 iframe 来显示目标链接页面</h2>
<p>iframe 可以显示一个目标链接的页面</p>
<p>目标链接的属性必须使用 iframe 的属性，如下实例:</p>
<div class="example">
<h2 class="example">实例</h2>
<div class="example_code">
<div class="hl-main"><span class="hl-brackets">&lt;</span><span class="hl-reserved">iframe</span><span class="hl-code"> </span><span class="hl-var">src</span><span class="hl-code">=</span><span class="hl-quotes">"</span><span class="hl-string">demo_iframe.htm</span><span class="hl-quotes">"</span><span class="hl-code"> </span><span class="hl-var">name</span><span class="hl-code">=</span><span class="hl-quotes">"</span><span class="hl-string">iframe_a</span><span class="hl-quotes">"</span><span class="hl-brackets">&gt;</span><span class="hl-brackets">&lt;/</span><span class="hl-reserved">iframe</span><span class="hl-brackets">&gt;</span><span class="hl-code">
</span><span class="hl-brackets">&lt;</span><span class="hl-reserved">p</span><span class="hl-brackets">&gt;</span><span class="hl-brackets">&lt;</span><span class="hl-reserved">a</span><span class="hl-code"> </span><span class="hl-var">href</span><span class="hl-code">=</span><span class="hl-quotes">"</span><span class="hl-string">https://www.runoob.com</span><span class="hl-quotes">"</span><span class="hl-code"> </span><span class="hl-var">target</span><span class="hl-code">=</span><span class="hl-quotes">"</span><span class="hl-string">iframe_a</span><span class="hl-quotes">"</span><span class="hl-code"> </span><span class="hl-var">rel</span><span class="hl-code">=</span><span class="hl-quotes">"</span><span class="hl-string">noopener</span><span class="hl-quotes">"</span><span class="hl-brackets">&gt;</span><span class="hl-code">RUNOOB.COM</span><span class="hl-brackets">&lt;/</span><span class="hl-reserved">a</span><span class="hl-brackets">&gt;</span><span class="hl-brackets">&lt;/</span><span class="hl-reserved">p</span><span class="hl-brackets">&gt;</span></div>
</div>
<br/>
<a class="tryitbtn"  rel="noopener" target="_blank">尝试一下 »</a>
</div>
<br/>
<hr/><h2>HTML iframe 标签</h2>
<table class="reference notranslate">
<tbody><tr>
<th align="left">标签</th>
<th align="left">说明</th>
</tr>
<tr>
<td><a >&lt;iframe&gt;</a></td>
<td>定义一个内联的iframe</td>
</tr>
</tbody></table> <div class="scroll-top"><a >返回顶部</a></div>
</div>

    </body>
    </html>
    